﻿using NetworkLib.Utilities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PBO.Network.Domain
{
    public class BattleSnapshot : DataByteArray
    {
        public string NewText { get; set; }
        public int TextColor { get; set; }
        public List<PokemonSnapshot> Pokemons { get; set; }

        #region abstract

        public override void Read(ByteArray byteArray)
        {
            NewText = byteArray.ReadUTF();
            TextColor = byteArray.ReadInt();
            Pokemons = DataByteArray.ReadList<PokemonSnapshot>(byteArray);
        }

        public override void Write(ByteArray byteArray)
        {
            byteArray.WriteUTF(NewText);
            byteArray.WriteInt(TextColor);
            DataByteArray.WriteList<PokemonSnapshot>(this.Pokemons, byteArray);
        }

        #endregion
    }
}
